<?php echo $header; ?>

	<?php echo $content_top; ?>

	<div class="breadcrumb grid_12">
		<?php foreach ($breadcrumbs as $breadcrumb) { ?>
		<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
		<?php } ?>
	</div>

	<div class="heading grid_12">
		<h1><?php echo $heading_title; ?></h1>
		<div id="notification"></div>
	</div>

	<div id="maincontent" class="grid_10 push_1">

		<?php if ($products) { 

			$colwidth = (int)(100/(count($products)+1));
			
		?>

		<div class="contentset center"><div class="inner"><span><?php echo $text_product; ?></span></div></div>
		
		<div class="nav-container">
			<ul class="nav-compare nav_<?php echo $colwidth; ?>">
				<li id="previous-column">&larr; <?php echo $this->language->get('text_previous'); ?></li>
				<li id="next-column"><?php echo $this->language->get('text_next'); ?> &rarr;</li>
			</ul>
		</div>

			<div id="compare-wrapper">

				<div class="compare-info plus_<?php echo $colwidth; ?>">
					
					<div class="row name">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_name; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>"><a href="<?php echo $products[$product['product_id']]['href']; ?>"><?php echo $products[$product['product_id']]['name']; ?></a></div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_image; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
							<?php if ($products[$product['product_id']]['thumb']) { ?>
								<a href="<?php echo $products[$product['product_id']]['href']; ?>">
								<img src="<?php echo $products[$product['product_id']]['thumb']; ?>" alt="<?php echo $products[$product['product_id']]['name']; ?>" />
								</a>
							<?php } ?>
						</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_price; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<?php if ($products[$product['product_id']]['price']) { ?>
								<?php if (!$products[$product['product_id']]['special']) { ?>
								<span class="price-new"><?php echo $products[$product['product_id']]['price']; ?></span>
								<?php } else { ?>
								<span class="price-old"><?php echo $products[$product['product_id']]['price']; ?></span> <span class="price-new"><?php echo $products[$product['product_id']]['special']; ?></span>
								<?php } ?>
								<?php } ?>
							</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_model; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<?php echo $products[$product['product_id']]['model']; ?>
						</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_manufacturer; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<?php echo $products[$product['product_id']]['manufacturer']; ?>
						</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_availability; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<?php echo $products[$product['product_id']]['availability']; ?>
						</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_rating; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<img src="catalog/view/theme/sellegance/images/stars-<?php echo $products[$product['product_id']]['rating']; ?>.png" alt="<?php echo $products[$product['product_id']]['reviews']; ?>" /><br />
								<?php echo $products[$product['product_id']]['reviews']; ?>
						</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_summary; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="description col_<?php echo $colwidth; ?>">
						<?php echo $products[$product['product_id']]['description']; ?>
						</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_weight; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<?php echo $products[$product['product_id']]['weight']; ?>
						</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>"><?php echo $text_dimension; ?></div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<?php echo $products[$product['product_id']]['length']; ?> x <?php echo $products[$product['product_id']]['width']; ?> x <?php echo $products[$product['product_id']]['height']; ?>
						</div>
						<?php } ?>
					</div>


					<?php foreach ($attribute_groups as $attribute_group) { ?>
						
						<div class="contentset center"><div class="inner"><span><?php echo $attribute_group['name']; ?></span></div></div>

						<?php foreach ($attribute_group['attribute'] as $key => $attribute) { ?>

						<div class="row">
							<div class="label col_<?php echo $colwidth; ?>"><?php echo $attribute['name']; ?></div>
							<?php foreach ($products as $product) { ?>
								<div class="col_<?php echo $colwidth; ?>">
								<?php if (isset($products[$product['product_id']]['attribute'][$key])) { ?>
								<?php echo $products[$product['product_id']]['attribute'][$key]; ?>
								<?php } else { ?>
								&nbsp;
								<?php } ?>
								</div>
							<?php } ?>
						</div>

						<?php } ?>

					<?php } ?>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>">&nbsp;</div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button cart small"><span><?php echo $button_cart; ?></span></a>
						</div>
						<?php } ?>
					</div>

					<div class="row">
						<div class="label col_<?php echo $colwidth; ?>">&nbsp;</div>
						<?php foreach ($products as $product) { ?>
						<div class="col_<?php echo $colwidth; ?>">
						<form id="remove_item" action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
								<input type="hidden" name="remove" value="<?php echo $product['product_id']; ?>" />
								<div class="remove"><a onclick="$('#remove_item').submit();" ><?php echo $text_remove; ?></a></div>
							</form>
						</div>
						<?php } ?>
					</div>

			</div>
		</div>
		


		<div class="buttons">
			<a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a>
		</div>

		<?php } else { ?>

		<div class="content"><?php echo $text_empty; ?></div>
		<div class="buttons">
			<a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a>
		</div>
		
		<?php } ?>

	</div> <!-- #maincontent -->

	<?php echo $content_bottom; ?>

	<script type="text/javascript">

	$(document).ready(function() {
	    $('#next-column').click(function(event) {
	        event.preventDefault();
	        $('#compare-wrapper').animate({scrollLeft:'+=95'}, 'slow');        
	    });
	    $('#previous-column').click(function(event) {
	        event.preventDefault();
	        $('#compare-wrapper').animate({scrollLeft:'-=95'}, 'slow');        
	    });
	});

	</script>
	
<?php echo $footer; ?>